/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javase - Math1
 * <p>Powered by webrx On 2021-11-24 09:39:10
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Math1 {
    public static void main(String[] args) {
        //java体系 java.lang.Math java.lang 是包，是系统包，此包下的类是直接使用，不允许导入import
        System.out.printf("%.0f %<.1f %<.2f %<.3f %<.6f", Math.PI);


        double pi = Math.PI;
        System.out.println(pi);
        System.out.println(Math.random());
        System.out.println(Math.round(1.4));//1
        System.out.println(Math.round(1.5));//2
        System.out.println(Math.floor(1.4));//1.0
        System.out.println(Math.floor(1.5));//1.0
        System.out.println(Math.ceil(1.4));//2.0
        System.out.println(Math.ceil(1.5));//2.0
        System.out.println(Math.pow(2, 3));
        System.out.println(Math.max(10, 20));//20
        System.out.println(Math.min(10, 20));//10
    }
}
